<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>单位管理</title>
<link rel="stylesheet" href="<%=path%>/easyui/themes/default/easyui.css"
	type="text/css" media="screen" />
<link rel="stylesheet" href="<%=path%>/easyui/themes/icon.css"
	type="text/css" media="screen" />
<link rel="stylesheet" href="<%=path%>/css/main.css" type="text/css"
	media="screen" />
<link rel="stylesheet" type="text/css" href="<%=path%>/css/Tooltip.css" />
<script src="<%=path%>/easyui/jquery-1.4.4.min.js"></script>
<script src="<%=path%>/easyui/jquery.easyui.min.js"></script>
<!-- mytab -->
<script src="<%=path%>/myjs/myTab.js"></script>
<!-- sys -->
<script src="<%=path%>/myjs/sys.js"></script>
<script src="<%=path%>/myjs/company/tCompanyInfo.js"></script>
<script src="<%=path%>/easyui/easyMask.js"></script>
<script src="<%=path%>/easyui/easyUI.js"></script>
<script src="<%=path%>/easyui/easyLayer.js"></script>
<!-- validation -->
<!-- 
<script src="<%=path%>/validation/jquery.bgiframe.min.js"></script>
<script src="<%=path%>/validation/easy_validator.pack.js"></script>
 -->
<script>
		var greyLayer ;
		var projectUrl = '<%=path%>';
		$(function(){
			grid = $('#tt').datagrid({
				url:'<%=path%>/company_info/getUnits',
				pagination:true,
				singleSelect:true,
				fit:true,//表格自动填充
				loadMsg:'正在努力为您加载，请稍作等待…',//加载信息
				idField : 'c_seq', //指示该字段是一个标识字段。
				pageNumber : 1, //当前页码
				pageSize:10,
				toolbar:[{
					text:'新增',
					iconCls:'icon-add',
					handler:'newTCompanyInfo'
				},'-',{
					text:'修改',
					iconCls:'icon-edit',
					handler:'editTCompanyInfo'
					
				},'-',{
					text:'删除',
					iconCls:'icon-remove',
					handler:'delTCompanyInfo'
				}]
			});
			//初始化pagination工具开始
			var pagetool = $('#tt').datagrid('getPager');
			pagetool.pagination({				
					beforePageText:'第',
					afterPageText:'页，共{pages}页',
					displayMsg:'显示从 {from} 到  {to} , 总记录 {total} '});
			//初始化pagination工具结束
			$('body').layout();
			$('#btn-save,#btn-cancel').linkbutton();
			win = $('#user-window').window({
				collapsible:false,
				minimizable:false, 
				maximizable:true, 
				closable:true,
				onClose:function(){greyLayer.close();},
				closed:true,
				cache:false	
			});
			form = win.find('form');
			greyLayer = new easyMask(null,'100%','100%',100,'#000',8,true);
		});
		
	</script>
</head>
<body>
<div id="window-center" region="center" fit="true" style="padding: 5px;">
<table id="tt">
	<thead>
		<tr>
			<th field="company_id" width="80%" sortable=true>序号</th>
			<th field="company_code" width="100%">单位代码</th>
			<th field="company_name" width="100%">单位名称</th>
			<th field="company_level" width="100%">单位级别</th>
			<th field="company_province" width="150%">所属省</th>
			<th field="company_city" width="150%">所属城市</th>
			<th field="company_addr" width="150%">地址</th>
		</tr>
	</thead>
</table>
</div>
<div id="user-window" title="单位管理窗口"
	style="width: 400px; height: 450px;">
<div style="padding: 20px 20px 40px 80px;">

<form method="post">
<table>
	<tr>
		<td>单位代码：</td>
		<td><input name="company_code" class="easyui-validatebox" type="text" required="true"></input>
		</td>
	</tr>
	<tr>
		<td>单位名称：</td>
		<td><input name="company_name" class="easyui-validatebox" type="text" required="true"></input></td>
	</tr>
	<!--  
	<tr>
		<td>单位等级：</td>
		<td>
			<select name="company_level" >
			<option>-请选择-</option>
				<option value="1">一级</option>
				<option value="2">二级</option>
				<option value="3">三级</option>
			</select>
		</td>
	</tr>
	<tr>
		<td>上级单位：</td>
		<td><input name="parent_id" class="easyui-validatebox" type="text"></input></td>
	</tr>
	-->
	<tr>
		<td>所属省：</td>
		<td><input name="company_province" class="easyui-validatebox" type="text"></input></td>
	</tr>
	<tr>
		<td>所属城市：</td>
		<td><input name="company_city" class="easyui-validatebox" type="text"></input></td>
	</tr>
	<tr>
		<td>地址：</td>
		<td><input name="company_addr" class="easyui-validatebox" type="text"></input></td>
	</tr>
</table>
</form>

</div>
<div style="text-align: center; padding: 5px;"><a
	href="javascript:void(0)" onclick="saveTCompanyInfo()" id="btn-save"
	icon="icon-save">确定</a> <a href="javascript:void(0)"
	onclick="closeWindow()" id="btn-cancel" icon="icon-cancel">取消</a></div>
</div>
</body>
</html>
